<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <th:block th:include="include :: header('项目进度')" />
</head>
<body class="gray-bg">
  <div class="form-content">
    <form id="form-progress-edit" class="form-horizontal">
      <div class="row" th:each="pr,prStat : ${list}">
        <label class="col-sm-2 control-label" th:text="${prStat.count}+'.'+${pr.progressName}"></label>
        <div class="col-sm-4">
          <div class="form-group">
            <label class="col-sm-4 control-label">负责人：</label>
            <div class="col-sm-8">
              <input th:name="'ppList['+${prStat.index}+'].progressId'" th:value="${pr.progressId}"  type="hidden">
              <select th:name="'ppList['+${prStat.index}+'].userId'" class="form-control">
                <option value="">--请选择--</option>
                <option th:each="user:${users}" th:value="${user.userId}" th:text="${user.userName}" th:selected="${pr.userId == user.userId}"></option>
              </select>
            </div>
          </div>
        </div>
        <div class="col-sm-4">
          <div class="form-group">
            <label class="col-sm-4 control-label">批注：</label>
            <div class="col-sm-8">
              <input th:name="'ppList['+${prStat.index}+'].remark'" class="form-control" th:value="${pr.remark}" type="text"
                     maxlength="100">
            </div>
          </div>
        </div>
      </div>
    </form>
  </div>
  <div class="row">
    <div class="col-sm-offset-5 col-sm-10">
      <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
      <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
    </div>
  </div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
  var prefix = ctx + "project/projectProgress";
  function submitHandler() {
    if ($.validate.form()) {
      var data = $("#form-progress-edit").serializeArray();
      $.operate.saveTab(prefix + "/edit", data);
    }
  }
</script>
</body>
</html>